/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package td4;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;
/**
 *
 * @author ?
 */
public class Communica extends Thread{
    Socket socket;
    BufferedReader entree;
    PrintStream sortie;
    
    Communica(Socket socket){
    
        this.socket=socket;
        try{
            entree=new BufferedReader(new InputStreamReader(socket.getInputStream()));
            sortie=new PrintStream(socket.getOutputStream());
        }
        catch(IOException exc) {
			try {
				socket.close();
			}
			catch(IOException e){}
		}
    }
    
    
    @Override
	public void run() {
		String texte;
		int compteur = 0;

		try {
			sortie.close();
			entree.close();
			socket.close();
		}
		catch(IOException e) {}
	}
    

}
